<template>
    <div id="hospital">
        <el-button @click="insertList" class="slot-btn-top" type="primary" size="small" style="float:left;">添加</el-button>
        <el-input type="text" v-model="searchData" auto-complete="off" placeholder="请输入需要查询的信息" style="float:left;margin-left:3px;margin-bottom:1px;width:60%;">
            <template slot="prepend">查询</template>
        </el-input>
        <el-table :data="dataList.filter(data => data.hospitalName.includes(searchData)).slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="tableHeight" :header-cell-style="getRowClass">
            <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
            <el-table-column prop="hospitalName" label="医院名称" sortable min-width="280"></el-table-column>
            <el-table-column prop="hospitalLevelDesc" label="医院级别" sortable min-width="140"></el-table-column>
            <el-table-column prop="hospitalTypeDesc" label="医院类别" sortable min-width="140"></el-table-column>
            <el-table-column prop="hospitalTel" label="医院电话" sortable min-width="180"></el-table-column>
            <el-table-column prop="addressDetail" label="医院地址" :formatter="formatAddress" sortable min-width="350"></el-table-column>
            <el-table-column fixed="right" label="操作" sortable align="center" width="75">
                <template slot-scope="scope">
                    <el-button @click="updateList(scope.row)" type="text" size="mini">查看</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                       :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize"
                       layout="total, sizes, prev, pager, next, jumper" :total="dataList.length"></el-pagination>


        <!-- 详情框 -->
        <el-dialog :title="dialogTitle" width="80%" top="60px" :visible.sync="isDialog" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-tabs v-model="activeName" @tab-click="handleClick" style="padding-bottom: 15px;">
                <el-tab-pane label="医院基本信息" name="1" :style="dialogHeight">
                    <el-button @click="openDistributor" type="primary">经销商填写信息</el-button>

                    <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="120px" :model="dialogList">
                        <el-form-item label="医院名称">
                            <el-input v-model="dialogList.hospitalName"></el-input>
                        </el-form-item>
                        <el-form-item label="英文名称">
                            <el-input v-model="dialogList.nameEn"></el-input>
                        </el-form-item>
                        <el-form-item label="成立时间(年)">
                            <el-input v-model="dialogList.establishDate"></el-input>
                        </el-form-item>
                        <el-form-item label="医院类别">
                            <el-select v-model="dialogList.hospitalType">
                                <el-option v-for="item in hospitalCategory"  :key="item.code" :value="item.code"
                                           :label="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="医院级别">
                            <el-select v-model="dialogList.hospitalLevel">
                                <el-option v-for="item in hospitalLevel" :key="item.code" :value="item.code"
                                           :label="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="医院电话">
                            <el-input v-model="dialogList.hospitalTel"></el-input>
                        </el-form-item>
                        <el-form-item label="医院院训">
                            <el-input v-model="dialogList.hospitalTraining"></el-input>
                        </el-form-item>
                        <el-form-item label="是否医保定点">
                            <el-select v-model="dialogList.medicalInsurancePoint">
                                <el-option :value="1" label="是"></el-option>
                                <el-option :value="0" label="否"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="经营类型">
                            <el-select v-model="dialogList.economicType">
                                <el-option value="营利性" label="营利性"></el-option>
                                <el-option value="非营利性" label="非营利性"></el-option>
                                <el-option value="其他" label="其他"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="院长">
                            <el-input v-model="dialogList.dean"></el-input>
                        </el-form-item>
                        <el-form-item label="目标客户">
                            <el-select v-model="dialogList.targetCustomer">
                                 <el-option :value="1" label="是"></el-option>
                                 <el-option :value="0" label="否"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="120px" :model="dialogList">
                        <el-form-item label="医院地址">
                            <div style="width: 610px;">
                                <el-select v-model="sheng" @change="choseSheng(sheng,'')" placeholder="省级地区"><el-option v-for="item in shengs" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                                <el-select v-model="shi" @change="choseCity(shi,'')" placeholder="市级地区"><el-option v-for="item in shis" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                                <el-select v-model="qu" @change="choseBlock(qu,'')" placeholder="区级地区"><el-option v-for="item in qus" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                                <el-input v-model="dialogList.addressDetail" style="margin-top: 5px;" type="textarea" :rows="2" placeholder="请输入详细地址" ></el-input>
                            </div>
                        </el-form-item>
                    </el-form>

                    <div style="text-align: right;" v-if="dialogTitle==='添加'"><el-button @click="submitList" type="primary">确 定</el-button></div>
                    <div style="text-align: right;" v-if="dialogTitle==='编辑'"><el-button @click="submitList" type="primary">确 定</el-button></div>
                </el-tab-pane>
                <el-tab-pane label="医院规模信息" name="2" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertScaleList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogScaleData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border
                              :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="totalArea" label="总经营面积/亩" sortable min-width="140"></el-table-column>
                        <el-table-column prop="businessArea" label="业务面积/平方米" sortable
                                         min-width="160"></el-table-column>
                        <el-table-column prop="regionNum" label="院区数量" sortable min-width="110"></el-table-column>
                        <el-table-column prop="regionExample" label="院区列举" sortable min-width="200"></el-table-column>
                        <el-table-column prop="bedNum" label="院本部床位数" sortable min-width="140"></el-table-column>
                        <el-table-column prop="visitorsFlowrate" label="院本部人流量/天" sortable
                                         min-width="170"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable
                                         min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                   :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]"
                                   :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper"
                                   :total="dialogScaleData.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="人员团队信息" name="3" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertPersonList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogPersonData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="name" label="人员名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="tel" label="联系电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="wx" label="微信" sortable min-width="160"></el-table-column>
                        <el-table-column prop="sectionOfficeName" label="所属科室" sortable min-width="160"></el-table-column>
                        <el-table-column prop="duties" label="职务" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogPersonData.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="其他职能部门信息" name="4" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertOfunctionalDepList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogOfunctionalDepData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="deptName" label="部门名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="deptFunction" label="部门职能" sortable min-width="160"></el-table-column>
                        <el-table-column prop="chargePerson" label="部门负责人" sortable min-width="120"></el-table-column>
                        <el-table-column prop="tel" label="联系电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="wx" label="微信" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogOfunctionalDepData.length"></el-pagination>

                </el-tab-pane>
                <el-tab-pane label="设施设备信息" name="5" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertFacandEquipList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogFacandEquipData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="equipmentName" label="设备名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="equipmentFunction" label="主要功能" sortable min-width="160"></el-table-column>
                        <el-table-column prop="equipmentTotal" label="设备数量" sortable min-width="120"></el-table-column>
                        <el-table-column prop="equipmentOffice" label="所属科室" sortable min-width="160"></el-table-column>
                        <el-table-column prop="chargePerson" label="设备负责人" sortable min-width="160"></el-table-column>
                        <el-table-column prop="tel" label="负责人电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="provideUnit" label="设备提供单位" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogFacandEquipData.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="竞争对手信息" name="6" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertCompetitorList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogCompetitorData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="hospitalName" label="医院名称" sortable min-width="280"></el-table-column>
                        <el-table-column prop="addressDetail" label="医院地址" :formatter="formatAddress" sortable min-width="350"></el-table-column>
                        <el-table-column prop="hospitalTypeDesc" label="医院类别" sortable min-width="120"></el-table-column>
                        <el-table-column prop="hospitalLevelDesc" label="医院级别" sortable min-width="120"></el-table-column>
                        <el-table-column prop="competeOffice" label="竞争科室" sortable min-width="280"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogCompetitorData.length"></el-pagination>

                </el-tab-pane>
                <el-tab-pane label="意向信息" name="7" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertIntentionList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogIntentionData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="intentionMsg" label="意向信息" sortable min-width="280"></el-table-column>
                        <el-table-column prop="provider" label="意向信息提供者" sortable min-width="150"></el-table-column>
                        <el-table-column prop="providerOffice" label="提供者科室" sortable min-width="120"></el-table-column>
                        <el-table-column prop="providerDuties" label="提供者职务" sortable min-width="140"></el-table-column>
                        <el-table-column prop="providerTel" label="提供者电话" sortable min-width="150"></el-table-column>
                        <el-table-column prop="providerWx" label="提供者微信" sortable min-width="150"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogIntentionData.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="其他备注信息" name="8" v-if="dialogTitle!=='添加'" :style="dialogHeight">
                    <el-button @click="insertRemarksList" class="slot-btn-top" type="primary" size="small">添加</el-button>
                    <el-table :data="dialogRemarksData.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="remarks" label="备注信息" sortable min-width="400"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogRemarksData.length"></el-pagination>

                </el-tab-pane>
            </el-tabs>
        </el-dialog>

        <!-- 医院规模信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogScale" :close-on-click-modal="false"
                   style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="180px"
                     :model="dialogScaleList">
                <el-form-item label="总经营面积/亩">
                    <el-input v-model="dialogScaleList.totalArea"></el-input>
                </el-form-item>
                <el-form-item label="业务面积约/平方米">
                    <el-input v-model="dialogScaleList.businessArea"></el-input>
                </el-form-item>
                <el-form-item label="院区数量">
                    <el-input v-model="dialogScaleList.regionNum"></el-input>
                </el-form-item>
                <el-form-item label="院本部床位数">
                    <el-input v-model="dialogScaleList.bedNum"></el-input>
                </el-form-item>
                <el-form-item label="院本部人流量/天">
                    <el-input v-model="dialogScaleList.visitorsFlowrate"></el-input>
                </el-form-item>
                <el-form-item label="院区列举">
                    <el-input v-model="dialogScaleList.regionExample" type="textarea" :rows="4"
                              style="width: 200px;"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitScaleList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 人员团队信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogPerson" :close-on-click-modal="false"
                   style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="180px"
                     :model="dialogPersonList">
                <el-form-item label="人员名称">
                    <el-input v-model="dialogPersonList.name"></el-input>
                </el-form-item>
                <el-form-item label="联系电话">
                    <el-input v-model="dialogPersonList.tel"></el-input>
                </el-form-item>
                <el-form-item label="微信">
                    <el-input v-model="dialogPersonList.wx"></el-input>
                </el-form-item>
                <el-form-item label="所属科室">
                    <el-select v-model="dialogPersonList.sectionOffice">
                        <el-option v-for="item in departments" :key="item.code" :label="item.name" :value="item.code"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="职务">
                    <el-input v-model="dialogPersonList.duties"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitPersonList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 其他职能部门信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogOfunctionalDep" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="180px" :model="dialogOfunctionalDepList">
                <el-form-item label="部门名称">
                    <el-input v-model="dialogOfunctionalDepList.deptName"></el-input>
                </el-form-item>
                <el-form-item label="部门职能">
                    <el-input v-model="dialogOfunctionalDepList.deptFunction"></el-input>
                </el-form-item>
                <el-form-item label="部门负责人">
                    <el-input v-model="dialogOfunctionalDepList.chargePerson"></el-input>
                </el-form-item>
                <el-form-item label="联系电话">
                    <el-input v-model="dialogOfunctionalDepList.tel"></el-input>
                </el-form-item>
                <el-form-item label="微信">
                    <el-input v-model="dialogOfunctionalDepList.wx"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitOfunctionalDepList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 设施设备信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogFacandEquip" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="180px" :model="dialogFacandEquipList">
                <el-form-item label="设备名称">
                    <el-input v-model="dialogFacandEquipList.equipmentName"></el-input>
                </el-form-item>
                <el-form-item label="主要功能">
                    <el-input v-model="dialogFacandEquipList.equipmentFunction" type="textarea" :rows="4" style="width: 200px;"></el-input>
                </el-form-item>
                <el-form-item label="设备数量">
                    <el-input v-model="dialogFacandEquipList.equipmentTotal"></el-input>
                </el-form-item>
                <el-form-item label="所属科室">
                    <el-input v-model="dialogFacandEquipList.equipmentOffice"></el-input>
                </el-form-item>
                <el-form-item label="设备负责人">
                    <el-input v-model="dialogFacandEquipList.chargePerson"></el-input>
                </el-form-item>
                <el-form-item label="负责人电话">
                    <el-input v-model="dialogFacandEquipList.tel"></el-input>
                </el-form-item>
                <el-form-item label="设备提供单位">
                    <el-input v-model="dialogFacandEquipList.provideUnit"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitFacandEquipList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 竞争对手信息 -->
        <el-dialog title="添加" width="800px" center :visible.sync="isDialogCompetitor" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="120px" :model="dialogCompetitorList">
                <el-form-item label="医院名称">
                    <el-input v-model="dialogCompetitorList.hospitalName"></el-input>
                </el-form-item>
                <el-form-item label="医院类别">
                    <el-select v-model="dialogCompetitorList.hospitalType">
                        <el-option v-for="item in hospitalCategory" :key="item.code" :value="item.code" :label="item.name"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="医院级别">
                    <el-select v-model="dialogCompetitorList.hospitalLevel">
                        <el-option v-for="item in hospitalLevel" :key="item.code" :value="item.code" :label="item.name"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="竞争科室">
                    <el-input v-model="dialogCompetitorList.competeOffice"></el-input>
                </el-form-item>
            </el-form>
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="120px" :model="dialogCompetitorList">
                <el-form-item label="医院地址">
                    <div style="width: 610px;">
                        <el-select v-model="sheng1" @change="choseSheng(sheng1,1)" placeholder="省级地区"><el-option v-for="item in shengs" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                        <el-select v-model="shi1" @change="choseCity(shi1,1)" placeholder="市级地区"><el-option v-for="item in shis" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                        <el-select v-model="qu1" @change="choseBlock(qu1,1)" placeholder="区级地区"><el-option v-for="item in qus" :key="item.value" :label="item.value" :value="item.value"></el-option></el-select>
                        <el-input v-model="dialogCompetitorList.addressDetail" style="margin-top: 5px;" type="textarea" :rows="2" placeholder="请输入详细地址" ></el-input>
                    </div>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitCompetitorList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 意向信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogIntention" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="180px" :model="dialogIntentionList">
                <el-form-item label="意向信息">
                    <el-input v-model="dialogIntentionList.intentionMsg" type="textarea" style="width: 200px;" :rows="4"></el-input>
                </el-form-item>
                <el-form-item label="意向信息提供者">
                    <el-input v-model="dialogIntentionList.provider"></el-input>
                </el-form-item>
                <el-form-item label="提供者科室">
                    <el-input v-model="dialogIntentionList.providerOffice"></el-input>
                </el-form-item>
                <el-form-item label="提供者职务">
                    <el-input v-model="dialogIntentionList.providerDuties"></el-input>
                </el-form-item>
                <el-form-item label="提供者电话">
                    <el-input v-model="dialogIntentionList.providerTel"></el-input>
                </el-form-item>
                <el-form-item label="提供者微信">
                    <el-input v-model="dialogIntentionList.providerWx"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitIntentionList" type="primary">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 其他备注信息 -->
        <el-dialog title="添加" width="550px" center :visible.sync="isDialogRemarks" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-form :inline="true" class="demo-form-inline" label-position="right" label-width="120px" :model="dialogRemarksList">
                <el-form-item label="备注信息">
                    <el-input v-model="dialogRemarksList.remarks" type="textarea" style="width: 310px;" :rows="8"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right;" slot="footer">
                <el-button @click="submitRemarksList" type="primary">确 定</el-button>
            </div>
        </el-dialog>


        <!-- 经销商填写信息 -->
        <el-dialog title="经销商填写信息" width="75%" top="60px" :visible.sync="isDialogDistributor" :close-on-click-modal="false" style="padding-bottom: 15px;">
            <el-tabs v-model="activeName1" @tab-click="handleClick1" style="padding-bottom: 15px;">
                <el-tab-pane label="医院规模信息" name="1" :style="dialogHeight">
                    <el-table :data="dialogScaleData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="totalArea" label="总经营面积/亩" sortable min-width="140"></el-table-column>
                        <el-table-column prop="businessArea" label="业务面积/平方米" sortable
                                         min-width="160"></el-table-column>
                        <el-table-column prop="regionNum" label="院区数量" sortable min-width="110"></el-table-column>
                        <el-table-column prop="regionExample" label="院区列举" sortable min-width="200"></el-table-column>
                        <el-table-column prop="bedNum" label="院本部床位数" sortable min-width="140"></el-table-column>
                        <el-table-column prop="visitorsFlowrate" label="院本部人流量/天" sortable
                                         min-width="170"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable
                                         min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogScaleData1.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="人员团队信息" name="2" :style="dialogHeight">
                    <el-table :data="dialogPersonData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="name" label="人员名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="tel" label="联系电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="wx" label="微信" sortable min-width="160"></el-table-column>
                        <el-table-column prop="sectionOfficeName" label="所属科室" sortable min-width="160"></el-table-column>
                        <el-table-column prop="duties" label="职务" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogPersonData1.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="其他职能部门信息" name="3" :style="dialogHeight">
                    <el-table :data="dialogOfunctionalDepData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="deptName" label="部门名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="deptFunction" label="部门职能" sortable min-width="160"></el-table-column>
                        <el-table-column prop="chargePerson" label="部门负责人" sortable min-width="120"></el-table-column>
                        <el-table-column prop="tel" label="联系电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="wx" label="微信" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogOfunctionalDepData1.length"></el-pagination>

                </el-tab-pane>
                <el-tab-pane label="设施设备信息" name="4" :style="dialogHeight">
                    <el-table :data="dialogFacandEquipData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="equipmentName" label="设备名称" sortable min-width="140"></el-table-column>
                        <el-table-column prop="equipmentFunction" label="主要功能" sortable min-width="160"></el-table-column>
                        <el-table-column prop="equipmentTotal" label="设备数量" sortable min-width="120"></el-table-column>
                        <el-table-column prop="equipmentOffice" label="所属科室" sortable min-width="160"></el-table-column>
                        <el-table-column prop="chargePerson" label="设备负责人" sortable min-width="160"></el-table-column>
                        <el-table-column prop="tel" label="负责人电话" sortable min-width="160"></el-table-column>
                        <el-table-column prop="provideUnit" label="设备提供单位" sortable min-width="160"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogFacandEquipData1.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="竞争对手信息" name="5" :style="dialogHeight">
                    <el-table :data="dialogCompetitorData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="hospitalName" label="医院名称" sortable min-width="280"></el-table-column>
                        <el-table-column prop="addressDetail" label="医院地址" :formatter="formatAddress" sortable min-width="350"></el-table-column>
                        <el-table-column prop="hospitalTypeDesc" label="医院类别" sortable min-width="120"></el-table-column>
                        <el-table-column prop="hospitalLevelDesc" label="医院级别" sortable min-width="120"></el-table-column>
                        <el-table-column prop="competeOffice" label="竞争科室" sortable min-width="280"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogCompetitorData1.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="意向信息" name="6" :style="dialogHeight">
                    <el-table :data="dialogIntentionData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="intentionMsg" label="意向信息" sortable min-width="280"></el-table-column>
                        <el-table-column prop="provider" label="意向信息提供者" sortable min-width="150"></el-table-column>
                        <el-table-column prop="providerOffice" label="提供者科室" sortable min-width="120"></el-table-column>
                        <el-table-column prop="providerDuties" label="提供者职务" sortable min-width="140"></el-table-column>
                        <el-table-column prop="providerTel" label="提供者电话" sortable min-width="150"></el-table-column>
                        <el-table-column prop="providerWx" label="提供者微信" sortable min-width="150"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogIntentionData1.length"></el-pagination>
                </el-tab-pane>
                <el-tab-pane label="其他备注信息" name="7" :style="dialogHeight">
                    <el-table :data="dialogRemarksData1.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe border :height="dialogTabPaneTableHeight + 30" :header-cell-style="getRowClass">
                        <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
                        <el-table-column prop="inputUnitDesc" label="经销商名称" sortable min-width="220"></el-table-column>
                        <el-table-column prop="remarks" label="备注信息" sortable min-width="400"></el-table-column>
                        <el-table-column prop="inputUserName" label="填写人" sortable min-width="100"></el-table-column>
                        <el-table-column prop="inputTime" label="填写时间" :formatter="formatTimestampToTime" sortable min-width="170"></el-table-column>
                    </el-table>
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="dialogRemarksData1.length"></el-pagination>

                </el-tab-pane>
            </el-tabs>
        </el-dialog>





    </div>
</template>

<script>
    export default {
        name: "BasicInfo",
        data() {
            let tokenId = sessionStorage.getItem("tokenId");
            return {
                searchData:'',
                // 三级联动
                addressData: {},
                shengs: '',
                shis: [],
                qus: [],
                city: '',
                block: '',


                tokenId: tokenId,
                currentPage: 1,
                pagesize: 10,
                activeName: '1',
                activeName1: '1',


                tableHeight: document.documentElement.clientHeight - 170,
                dataList: [],
                hospitalCategory: [],
                hospitalLevel: [],
                departments: [],

                // 详情框
                isOpenDealSub:false,    //详情框确定按钮防重复提交
                isDialog: false,
                dialogTitle: '',
                dialogHeight: {
                    height: document.documentElement.clientHeight - 230+ 'px',
                    minHeight: document.documentElement.clientHeight - 230+ 'px',
                    overflowY: 'auto',
                },
                dialogList: {
                    targetCustomer:"1",
                    addressDetail: "",
                    addressQuxian: "",
                    addressSheng: "",
                    addressShi: "",
                    applyStatus: "",
                    dean: "",
                    directDept: "",
                    economicType: "",
                    establishDate: "",
                    hospitalJd: "",
                    hospitalLevel: "",
                    hospitalLevelDesc: "",
                    hospitalName: "",
                    hospitalTel: "",
                    hospitalTraining: "",
                    hospitalType: "",
                    hospitalTypeDesc: "",
                    hospitalWd: "",
                    id: "",
                    inputTime: "",
                    inputUnit: "",
                    inputUnitDesc: "",
                    inputUnitType: "",
                    inputUserId: "",
                    inputUserName: "",
                    medicalInsurancePoint: "",
                    nameEn: "",
                    operateNature: "",
                },
                sheng: '四川省',
                shi: '成都市',
                qu: '',

                //医院规模
                dialogScaleData: [],
                isDialogScale: false,
                dialogTabPaneTableHeight: document.documentElement.clientHeight - 300,
                dialogScaleList: {
                    id: '',
                    totalArea: "",
                    businessArea: "",
                    regionNum: "",
                    regionExample: "",
                    bedNum: "",
                    visitorsFlowrate: "",
                    inputUnit: "",
                    inputUnitDesc: "",
                    inputUnitType: "",
                    inputUserId: "",
                    inputUserName: "",
                    inputTime: "",
                    baseId: "",
                },

                //人员团队信息
                dialogPersonData: [],
                isDialogPerson: false,
                dialogPersonList: {
                    id: '',
                    name: '',
                    tel: '',
                    wx: '',
                    sectionOffice: '',
                    duties: '',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                },

                //其他职能部门信息
                dialogOfunctionalDepData: [],
                isDialogOfunctionalDep: false,
                dialogOfunctionalDepList: {
                    id: '',
                    deptName:'',
                    deptFunction: '',
                    chargePerson: '',
                    tel: '',
                    wx: '',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
            },

                //设施设备信息
                dialogFacandEquipData: [],
                isDialogFacandEquip: false,
                dialogFacandEquipList: {
                    id: '',
                    equipmentName:'',
                    equipmentFunction:'',
                    equipmentTotal:'',
                    equipmentOffice:'',
                    chargePerson:'',
                    tel:'',
                    provideUnit:'',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                },

                //竞争对手信息
                dialogCompetitorData: [],
                isDialogCompetitor: false,
                dialogCompetitorList: {
                    id: '',
                    hospitalName:'',
                    addressSheng:'',
                    addressShi:'',
                    addressQuxian:'',
                    addressDetail:'',
                    hospitalType:'',
                    hospitalTypeDesc:'',
                    hospitalLevel:'',
                    hospitalLevelDesc:'',
                    competeOffice:'',
                    provideUnit:'',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                },
                sheng1: '',
                shi1: '',
                qu1: '',

                //意向信息
                dialogIntentionData: [],
                isDialogIntention: false,
                dialogIntentionList: {
                    id: '',
                    intentionMsg: '',
                    provider: '',
                    providerDuties: '',
                    providerOffice: '',
                    providerTel: '',
                    providerWx: '',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                },


                //其他备注信息
                dialogRemarksData: [],
                isDialogRemarks: false,
                dialogRemarksList: {
                    id: '',
                    remarks: '',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                },

                //查看经销商填写信息
                isDialogDistributor: false,
                dialogScaleData1:[],
                dialogPersonData1:[],
                dialogOfunctionalDepData1:[],
                dialogFacandEquipData1:[],
                dialogCompetitorData1:[],
                dialogIntentionData1:[],
                dialogRemarksData1:[],


            }
        },
        created() {
            this.getData();
            this.getAllCityData();
            this.getHospitalCategoryData();
            this.getHospitalLevelData();
            this.getDepartmentData();
            this.getHospitalCategoryData();
        },
        methods: {

            getHospitalCategoryData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalBase/getHospitalTypeLevel/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.hospitalCategory = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },
            getHospitalLevelData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalBase/getHospitalTypeLevel/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.hospitalLevel = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },
            getDepartmentData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/system/code/queryCoedByType/hospital_office?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.departments = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },
            getData() {
                let _this = this;
                let loading = this.$loading({
                    target: document.querySelector(".wrapper > .content-box"),
                    lock: true,
                    text: '正在努力加载中...',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.8)'
                });
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalBase/queryAllHospitalBaseList?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {

                    console.log(res.data)

                    if (res.data.statusCode == 200) {
                        _this.dataList = res.data.content;
                        loading.close();
                    } else {
                        _this.$message.error(res.data.desc);
                        loading.close();
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                    loading.close();
                })
            },
            getAllCityData(){
                let _this = this;
                this.$http.get('.././../static/json/map.json').then(function (response) {
                    if (response.status == 200) {
                        let data = response.data;
                        _this.addressData = response.data;
                        _this.shengs = [];
                        _this.city = [];
                        _this.block = [];
                        // 省市区数据分类
                        for (let item in data) {
                            if (item.match(/0000$/)) {//省
                                _this.shengs.push({id: item, value: data[item], children: []})
                            } else if (item.match(/00$/)) {//市
                                _this.city.push({id: item, value: data[item], children: []})
                            } else {//区
                                _this.block.push({id: item, value: data[item]});
                            }
                        }
                        // 分类市级
                        for (let index in _this.shengs) {
                            for (let index1 in _this.city) {
                                if (_this.shengs[index].id.slice(0, 2) === _this.city[index1].id.slice(0, 2)) {
                                    _this.shengs[index].children.push(_this.city[index1]);
                                }
                            }
                        }
                        // 分类区级
                        for (let item1 in _this.city) {
                            for (let item2 in _this.block) {
                                if (_this.block[item2].id.slice(0, 4) === _this.city[item1].id.slice(0, 4)) {
                                    _this.city[item1].children.push(_this.block[item2]);
                                }
                            }
                        }
                    } else {console.log(response.status);}
                }).catch(function (error) {console.log(typeof +error)})
            },


            //基本信息
            insertList() {
                this.isDialog = true;
                this.activeName = "1";
                this.dialogTitle = '添加';
                this.dialogList= {
                    addressDetail: "",
                    addressQuxian: "",
                    addressSheng: "",
                    addressShi: "",
                    applyStatus: "",
                    dean: "",
                    directDept: "",
                    economicType: "",
                    establishDate: "",
                    hospitalJd: "",
                    hospitalLevel: "",
                    hospitalLevelDesc: "",
                    hospitalName: "",
                    hospitalTel: "",
                    hospitalTraining: "",
                    hospitalType: "",
                    hospitalTypeDesc: "",
                    hospitalWd: "",
                    id: "",
                    inputTime: "",
                    inputUnit: "",
                    inputUnitDesc: "",
                    inputUnitType: "",
                    inputUserId: "",
                    inputUserName: "",
                    medicalInsurancePoint: "",
                    nameEn: "",
                    operateNature: "",
                };
                this.sheng= '';
                this.shi= '';
                this.qu= '';
                this.street= '';
            },
            updateList(row) {
                console.log( row )
                this.isDialog = true;
                this.activeName = "1";
                this.dialogTitle = '编辑';
                this.isOpenDealSub = true;
                this.getHospitalDetail(row.id);
            },
            getHospitalDetail(id){
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalBase/queryHospitalBase/' + id + '?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogList = res.data.content;
                        _this.dialogList.hospitalLevel = res.data.content.hospitalLevel+'';
                        _this.dialogList.hospitalType = res.data.content.hospitalType+'';
                        _this.sheng= res.data.content.addressSheng;
                        _this.shi= res.data.content.addressShi;
                        _this.qu= res.data.content.addressQuxian;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },

            submitList() {
                let _this = this;

                let url;
                if (this.dialogTitle === '添加') {
                    url = '/api/adscm/dealer/jyHospitalBase/addHospitalBase?tokenId=' + _this.tokenId;
                }else  if(this.dialogTitle ==='编辑'){
                    url = '/api/adscm/dealer/jyHospitalBase/updateHospitalBase?tokenId='+ _this.tokenId;
                }
                if(!_this.isOpenDealSub){
                    return;
                }
                _this.isOpenDealSub = false;
                _this.dialogList.addressSheng = this.sheng;
                _this.dialogList.addressShi = this.shi;
                _this.dialogList.addressQuxian = this.qu;
                _this.dialogList.inputTime = "";
                console.log(_this.dialogList)

                this.$http({
                    url: url,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogList
                }).then(function (res) {

                    console.log(res.data)

                    if (res.data.statusCode == 200) {
                        _this.isDialog = false;
                        _this.getData()
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },


            //医院规模信息
            getScaleData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalScale/queryHospitalScale/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogScaleData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getScaleData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalScale/queryHospitalScale/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogScaleData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertScaleList() {
                this.isDialogScale = true;
                this.dialogScaleList= {
                    id: '',
                        totalArea: "",
                        businessArea: "",
                        regionNum: "",
                        regionExample: "",
                        bedNum: "",
                        visitorsFlowrate: "",
                        inputUnit: "",
                        inputUnitDesc: "",
                        inputUnitType: "",
                        inputUserId: "",
                        inputUserName: "",
                        inputTime: "",
                        baseId: "",
                };
            },
            submitScaleList() {
                let _this = this;
                _this.dialogScaleList.baseId = _this.dialogList.id;

                console.log(_this.dialogScaleList)
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalScale/addHospitalScale?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogScaleList
                }).then(function (res) {

                    console.log(res.data)

                    if (res.data.statusCode == 200) {
                        _this.isDialogScale = false;
                        _this.getScaleData()
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //人员团队信息
            getPersonData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalPersonnelTeam/queryPersonnelTeam/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogPersonData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getPersonData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalPersonnelTeam/queryPersonnelTeam/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogPersonData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertPersonList() {
                this.isDialogPerson = true;
                this.dialogPersonList= {
                    id: '',
                        name: '',
                        tel: '',
                        wx: '',
                        sectionOffice: '',
                        duties: '',
                        inputUnit: '',
                        inputUnitDesc: '',
                        inputUnitType: '',
                        inputUserId: '',
                        inputUserName: '',
                        inputTime: '',
                        baseId: '',
                };
            },
            submitPersonList() {
                let _this = this;
                _this.dialogPersonList.baseId = _this.dialogList.id;

                console.log(_this.dialogPersonList)

                this.$http({
                    url: '/api/adscm/dealer/jyHospitalPersonnelTeam/addPersonnelTeam?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogPersonList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogPerson = false;
                        _this.getPersonData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //其他职能部门信息
            getOfunctionalDepData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalFunctionalDept/queryFunctionalDept/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogOfunctionalDepData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getOfunctionalDepData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalFunctionalDept/queryFunctionalDept/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogOfunctionalDepData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertOfunctionalDepList() {
                this.isDialogOfunctionalDep = true;
                this.dialogOfunctionalDepList={
                    id: '',
                        deptName:'',
                        deptFunction: '',
                        chargePerson: '',
                        tel: '',
                        wx: '',
                        inputUnit: '',
                        inputUnitDesc: '',
                        inputUnitType: '',
                        inputUserId: '',
                        inputUserName: '',
                        inputTime: '',
                        baseId: '',
                };
            },
            submitOfunctionalDepList() {
                let _this = this;
                _this.dialogOfunctionalDepList.baseId = _this.dialogList.id;
                console.log(_this.dialogOfunctionalDepList)
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalFunctionalDept/addFunctionalDept?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogOfunctionalDepList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogOfunctionalDep = false;
                        _this.getOfunctionalDepData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //设施设备信息
            getFacandEquipData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalEquipment/queryEquipment/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogFacandEquipData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getFacandEquipData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalEquipment/queryEquipment/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogFacandEquipData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertFacandEquipList() {
                this.isDialogFacandEquip = true;
                this.dialogFacandEquipList= {
                    id: '',
                        equipmentName:'',
                        equipmentFunction:'',
                        equipmentTotal:'',
                        equipmentOffice:'',
                        chargePerson:'',
                        tel:'',
                        provideUnit:'',
                        inputUnit: '',
                        inputUnitDesc: '',
                        inputUnitType: '',
                        inputUserId: '',
                        inputUserName: '',
                        inputTime: '',
                        baseId: '',
                };
            },
            submitFacandEquipList() {
                let _this = this;
                _this.dialogFacandEquipList.baseId = _this.dialogList.id;
                console.log(_this.dialogFacandEquipList)
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalEquipment/addEquipment?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogFacandEquipList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogFacandEquip = false;
                        _this.getFacandEquipData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //竞争对手信息
            getCompetitorData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalCompeteHospital/queryCompeteHospital/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogCompetitorData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getCompetitorData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalCompeteHospital/queryCompeteHospital/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogCompetitorData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertCompetitorList() {
                this.isDialogCompetitor = true;
                this. dialogCompetitorList={
                    id: '',
                    hospitalName:'',
                    addressSheng:'',
                    addressShi:'',
                    addressQuxian:'',
                    addressDetail:'',
                    hospitalType:'',
                    hospitalTypeDesc:'',
                    hospitalLevel:'',
                    hospitalLevelDesc:'',
                    competeOffice:'',
                    provideUnit:'',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                };
                this.sheng1= '';
                this.shi1= '';
                this.qu1= '';
            },
            submitCompetitorList() {
                let _this = this;
                _this.dialogCompetitorList.baseId = _this.dialogList.id;
                _this.dialogCompetitorList.addressSheng = _this.sheng1;
                _this.dialogCompetitorList.addressShi = _this.shi1;
                _this.dialogCompetitorList.addressQuxian = _this.qu1;

                console.log(_this.dialogCompetitorList)


                this.$http({
                    url: '/api/adscm/dealer/jyHospitalCompeteHospital/addCompeteHospital?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogCompetitorList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogCompetitor = false;
                        _this.getCompetitorData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //意向信息
            getIntentionData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalIntention/queryIntention/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogIntentionData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getIntentionData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalIntention/queryIntention/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogIntentionData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertIntentionList() {
                this.isDialogIntention = true;
                this.dialogIntentionList= {
                    id: '',
                    intentionMsg: '',
                    provider: '',
                    providerDuties: '',
                    providerOffice: '',
                    providerTel: '',
                    providerWx: '',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                };
            },
            submitIntentionList() {
                let _this = this;
                _this.dialogIntentionList.baseId = _this.dialogList.id;
                console.log(_this.dialogIntentionList)
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalIntention/addIntention?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogIntentionList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogIntention = false;
                        _this.getIntentionData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //其他备注信息
            getRemarksData() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalRemarks/queryHospitalRemarks/' + _this.dialogList.id + '/1?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogRemarksData = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            getRemarksData1() {
                let _this = this;
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalRemarks/queryHospitalRemarks/' + _this.dialogList.id + '/2?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.dialogRemarksData1 = res.data.content;
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })
            },
            insertRemarksList() {
                this.isDialogRemarks = true;
                this.dialogRemarksList= {
                    id: '',
                    remarks:'',
                    inputUnit: '',
                    inputUnitDesc: '',
                    inputUnitType: '',
                    inputUserId: '',
                    inputUserName: '',
                    inputTime: '',
                    baseId: '',
                };
            },
            submitRemarksList() {
                let _this = this;
                _this.dialogRemarksList.baseId = _this.dialogList.id;
                console.log(_this.dialogRemarksList)
                this.$http({
                    url: '/api/adscm/dealer/jyHospitalRemarks/addHospitalRemarks?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                    data: _this.dialogRemarksList
                }).then(function (res) {
                    console.log(res.data)
                    if (res.data.statusCode == 200) {
                        _this.isDialogRemarks = false;
                        _this.getRemarksData();
                    } else {
                        _this.$message.error(res.data.desc);
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                })

            },

            //查看经销商填写信息
            openDistributor(){
                this.isDialogDistributor = true;
                this.activeName1 = '1';
                this.getScaleData1();


            },
            //修改经销商信息
            updateDistributor(){

            },



            // 加载china地点数据，三级
            choseSheng: function (e,index) {
                for (let index2 in this.shengs) {
                    if (e === this.shengs[index2].value) {
                        this.shis = this.shengs[index2].children;
                        this['shi'+index] = this.shengs[index2].children[0].value;
                        this.qus = this.shengs[index2].children[0].children;
                        this['qu'+index] = this.shengs[index2].children[0].children[0].value;
                        this.E = this.qus[0].value;
                    }
                }
            },
            choseCity: function (e,index) {
                for (let index3 in this.city) {
                    if (e === this.city[index3].value) {
                        this.qus = this.city[index3].children;
                        this['qu'+index] = this.city[index3].children[0].value;
                        this.E = this.qus[0].value;
                    }
                }

            },
            choseBlock: function (e,index) {
                this.E = e;
            },



            handleSizeChange: function (size) {
                this.pagesize = size;
            },
            handleCurrentChange: function (currentPage) {
                this.currentPage = currentPage;
            },
            handleClick(tab, event) {
                this.pagesize = 10;
                this.currentPage = 1;
                if (tab.name === '2') {
                    this.getScaleData();
                } else if (tab.name === '3') {
                    this.getPersonData();
                }else if (tab.name === '4') {
                    this.getOfunctionalDepData();
                }else if (tab.name === '5') {
                    this.getFacandEquipData();
                }else if (tab.name === '6') {
                    this.getCompetitorData();
                }else if (tab.name === '7') {
                    this.getIntentionData();
                }else if (tab.name === '8') {
                    this.getRemarksData();
                }
            },
            handleClick1(tab, event) {
                this.pagesize = 10;
                this.currentPage = 1;
                if (tab.name === '1') {
                    this.getScaleData1();
                } else if (tab.name === '2') {
                    this.getPersonData1();
                }else if (tab.name === '3') {
                    this.getOfunctionalDepData1();
                }else if (tab.name === '4') {
                    this.getFacandEquipData1();
                }else if (tab.name === '5') {
                    this.getCompetitorData1();
                }else if (tab.name === '6') {
                    this.getIntentionData1();
                }else if (tab.name === '7') {
                    this.getRemarksData1();
                }
            },
            formatTimestampToTime(row, column, cellValue, index) {
                return cellValue ? this.timestampToTime(cellValue) : '';
            },
            timestampToTime(timestamp) {
                if (timestamp) {
                    let date = new Date(timestamp);
                    let Y = date.getFullYear() + '-';
                    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
                    let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + " ";
                    let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ":";
                    let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ":";
                    let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
                    return timestamp ? Y + M + D + h + m + s : '';
                } else {
                    return '';
                }
            },
        }
    }
</script>

<style scoped>

</style>
